package org.example.test;

import java.io.*;

public class test7 {
    public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException {
        OutputStream os=new FileOutputStream("E:\\测试文件\\hello.txt");
        OutputStreamWriter osWriter=new OutputStreamWriter(os,"UTF-8");
        PrintWriter writer=new PrintWriter(osWriter);
        writer.println("我是第一行");
        writer.print("我是第二行\r\n");
        writer.printf("%d: 我的第三⾏\r\n", 1 + 1);
        writer.flush();
    }
}
